<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCrmLoginRecordTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        /**
         * CRM 链接访问企业用户中心记录
         */
        Schema::create('crm_visit_company_record', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->comment='CRM 链接访问企业用户中心记录';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('uid')->unsigned()->index('uid')->default(0)->comment('所属企业用户UID');
            $table->integer('crm_uid')->unsigned()->index('crm_uid')->default(0)->comment('CRM客服UID');
            $table->string('company_login_ip')->default('')->comment('登陆ip');
            $table->tinyInteger('type')->unsigned()->default(0)->comment('0销售，1客服');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
        Schema::dropIfExists('crm_visit_company_record');

    }
}
